﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAO;
using DTO;
namespace BUS
{
    public class BusinessDefControl
    {
        BusinessDefDataAccess _objDAO;
        public BusinessDefControl()
        {
            _objDAO = new DAO.BusinessDefDataAccess();
        }
        public string insertUpdate(DTO.BusinessDefInfo info)
        {
            string sErr = "";
            bool exists = _objDAO.exists(info, ref sErr);

            if (sErr != "") return sErr;

            if (exists) sErr = _objDAO.update(info);
            else _objDAO.add(info, ref sErr);

            return sErr;
        }

        public BusinessDefInfo get(ref string sErr)
        {
            return _objDAO.get(ref  sErr);
        }
    }
}
